services:
  mysqldb:
    container_name: mysqldb
    networks:
      - microservices-network
    image: mysql:latest
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: supersecret
      MYSQL_DATABASE: stage
      MYSQL_USER: user
      MYSQL_PASSWORD: secret2
    volumes:
      - ~/dbdata:/var/lib/mysql/
    ports:
      - 3306:3306
  vulnapp:
    environment:
      SPRING_DATASOURCE_URL: jdbc:mysql://mysqldb:3306/stage?allowMultiQueries=true&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
    depends_on:
      - mysqldb
    networks:
      - microservices-network
    image: .
    ports:
      - 8080:8080

networks:
  microservices-network:
    driver: bridge
